<template>
  <div class="creator">
        <b style="margin-right:15px">录入人</b>
        <el-select v-model="createrId" style="width:300px" placeholder="请选择" >
      <el-option
        v-for="item in userList"
        :key="item.id"
        :label="item.username"
        :value="item.id">
      </el-option>
    </el-select>
      </div>
</template>

<script>
import { list } from '@/api/base/users'
export default {
  name: 'SelectedCreator',
  created () {
    this.loading()
  },
  data () {
    return {
      createrId: null,
      userList: []
    }
  },
  methods: {
    async loading () {
      const res = await list({
        page: 1,
        pagesize: 10
      })
      this.userList = res.data.list
      this.$emit('sendCreatorId', this.createrId)
    }
  }
}
</script>

<style>

</style>
